<include file="public/layout" />

<body style="background-color: #FFF; overflow: auto;">

<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>

<div id="append_parent"></div>

<div id="ajaxwaitid"></div>

<div class="page">

    <div class="fixed-bar">

        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>

            <div class="subject">

                <h3>代理商管理 - 编辑代理商</h3>

                <h5>网站系统代理商管理</h5>

            </div>

        </div>

    </div>

    <form class="form-horizontal" id="agentHandle" action="{:U('Admin/agentHandle')}" method="post">

        <input type="hidden" name="act" value="{$act}">

        <input type="hidden" name="agent_id" value="{$info.agent_id}">

        <div class="ncap-form-default">
             <dl class="row">

                <dt class="tit">

                    <label for="agent_phone"><em>*</em>上级代理商</label>

                </dt>

                <dd class="opt">
                    <select class="small form-control" name="parent_id" id="parent_id">
                    <option value="0">无上级代理商</option>
                        <volist name="agent_list" id="item">
                            <option value="{$item.agent_id}" <if condition="$item['agent_id'] eq $info['parent_id']">selected=true</if> >{$item.agent_name}</option>
                        </volist>
                    </select>    

                    <span class="err"></span>

                    <p class="notic">请选择上级代理商</p>

                </dd>

            </dl>

            <dl class="row">

                <dt class="tit">

                    <label for="agent_name"><em>*</em>代理商名称</label>

                </dt>

                <dd class="opt">

                    <input type="text" name="agent_name" value="{$info.agent_name}" id="agent_name" class="input-txt">

                    <span class="err"></span>

                    <p class="notic">代理商名称</p>

                </dd>

            </dl>

            <dl class="row">

                <dt class="tit">

                    <label for="agent_desc"><em>*</em>代理商描述</label>

                </dt>

                <dd class="opt">

                    <input type="text" name="agent_desc" value="{$info.agent_desc}" id="agent_desc" class="input-txt">

                    <span class="err"></span>

                    <p class="notic">代理商描述</p>

                </dd>

            </dl>

            <dl class="row">

                <dt class="tit">

                    <label for="agent_contacts"><em>*</em>代理商联系人</label>

                </dt>

                <dd class="opt">

                    <input type="text" name="agent_contacts" value="{$info.agent_contacts}" id="agent_contacts" class="input-txt">

                    <span class="err"></span>

                    <p class="notic">代理商联系人</p>

                </dd>

            </dl>

            <dl class="row">

                <dt class="tit">

                    <label for="agent_phone"><em>*</em>代理商电话</label>

                </dt>

                <dd class="opt">

                    <input type="text" name="agent_phone" value="{$info.agent_phone}" id="agent_phone" class="input-txt">

                    <span class="err"></span>

                    <p class="notic">代理商电话</p>

                </dd>

            </dl>
             <dl class="row">

                <dt class="tit">

                    <label for="agent_phone"><em>*</em>代理商等级</label>

                </dt>

                <dd class="opt">
                    <select class="small form-control" name="level_id" id="level_id">
                    <option value="0">选择代理商等级</option>
                        <volist name="agent_level" id="item">
                            <option value="{$item.level_id}" <if condition="$item['level_id'] eq $info['level_id']">selected=true</if> >{$item.level_name}</option>
                        </volist>
                    </select>    

                    <span class="err"></span>

                    <p class="notic">代理商等级</p>

                </dd>

            </dl>

            <dl class="row">

                <dt class="tit">

                    <label for="admin_id"><em>*</em>所属管理员</label>

                </dt>

                <dd class="opt">

                    <!-- <select name="admin_id" id="admin_id">

                         <volist name="admin" id="item">

                             <option value="{$item.admin_id}" <if condition="$item[admin_id] eq $info[admin_id]"> selected="selected"</if> >{$item.user_name}</option>

                         </volist>

                     </select>-->

                    <volist name="admin" id="item">
                        <input type="checkbox" name="admin_id[]" value="{$item.admin_id}" class="btn btn-default" <if condition="$item['class']">checked='checked'</if> >{$item.user_name}
                    </volist>
                    <span class="err"></span>

                    <p class="notic">所属管理员</p>

                </dd>

            </dl>

            <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>

        </div>

    </form>

</div>

<script type="text/javascript">

    function adsubmit(){

        if($('input[name=agent_name]').val() == ''){

            layer.msg('代理商名称不能为空！', {icon: 2,time: 1000});   //alert('少年，用户名不能为空！');

            return false;

        }

        if($('input[name=agent_desc]').val() == ''){

            layer.msg('代理商描述不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');

            return false;

        }

        if($('input[name=agent_contacts]').val() == ''){

            layer.msg('代理商联系人不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');

            return false;

        }

        if($('input[name=agent_phone]').val() == ''){

            layer.msg('代理商电话不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');

            return false;

        }

        $('#agentHandle').submit();

    }

</script>

</body>

